package com.ucs.rest.resource;

import java.util.ArrayList;
import java.util.List;

import org.apache.log4j.Logger;
import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.resource.Get;
import org.restlet.resource.ServerResource;

import com.ucs.dao.UserDao;
import com.ucs.restlet.firstres.Item;
import com.ucs.restlet.firstres.XStremUtil;

public class UsersResource extends ServerResource{
	private static final Logger log = Logger.getLogger(UsersResource.class);
	private UserDao userDao;
	
	@Get("xml")
    public Representation toXml(){
    	try {
			return new StringRepresentation(XStremUtil.toXML(userDao.getUsers()));
		} catch (Exception e) {
			log.error("Could not get users", e);   
			return null;
		}
    	
    }
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
	public UserDao getUserDao() {
		return userDao;
	}


}
